Results 1 to 5 of 5

Thread: Check THIS out big guy

  1. #1
    TastinGood
    Guest TastinGood's Avatar

    Post

    #include <iostream.h>
    #include <stdio.h>

    int printcharacter(char ch)

    {
    switch(ch)

    { case 'a':
    case 'e':
    case 'i':
    case 'o':
    case 'u':
    return 1;
    default:
    return 0;


    }
    }
    void main()
    {

    char ch;
    int vowel;

    cout << "Enter character: " << endl;




    while ((ch = getchar()) !='\n')
    {
    vowel = printcharacter (ch);
    if (printcharacter(ch))
    cout << ch << " is a vowel" << endl;
    else
    cout << ch << " is a consonant" << endl;






    }
    }


    Oh yes....I am the man!


    ------------------

  2. #2
    Senior Hostboard Member Hannibal's Avatar
    Join Date
    January 16th, 2001
    Posts
    2,688
    Follows
    0
    Following
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)

    Post

    That's either a Basic program, or a C program to get a program to have the user input a character, and when he does the program either tells him if it's a vowel or a consonant.


    But I don't see where your allowing the input from the user.
    YOu have to remember, users need instruction!

    ------------------
    As miserable as life may be I hold it pretty precious...

    If I lose the light of the sun, I will write by candlelight, moonlight, no light. If I lose paper and ink, I wil write in blood on forgotten walls. I will write always, I will capture nights all over the world and bring them to you.
    Word And Voice
    Motocross Fanatics
    General Philosophy

  3. #3
    TastinGood
    Guest TastinGood's Avatar

    Post

    <BLOCKQUOTE><font size="1" face="Bradley Hand ITC, Tahoma, Lucinda Console">quote:</font><HR>Originally posted by TastinGood:


    cout << "Enter character: " << endl;


    <HR></BLOCKQUOTE>

    ------------------


    [This message has been edited by TastinGood (edited February 21, 2002).]

  4. #4
    Inactive Member zelazny's Avatar
    Join Date
    July 8th, 2001
    Posts
    3,495
    Follows
    0
    Following
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)

    Post

    what's wrong with printf?

    ------------------
    Sure the universe is a great place, but if it wasn't here, no-one would miss it.

  5. #5
    Inactive Member gnosis_within's Avatar
    Join Date
    May 23rd, 2001
    Posts
    318
    Follows
    0
    Following
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    that is sad....you have been in that class for over a month, and that is the best you can do.

    ------------------
    Look at that. She think I got siphlus and TB and a hard on and I gonna cut her up with a razor and lif her purse. Ooo-Wee.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •